home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 25
/
Volume 25 - JOGO DISK .iso
/
Games
/
the_jewel_hunter.swf
/
scripts
/
frame_2
/
DoAction.as
Wrap
Text File
|
2006-06-13
|
2KB
|
85 lines
Stage.scaleMode = "noScale";
Stage.showMenu = false;
_global.Game = new Object();
Game.scene = this;
Game.mspeed = 1;
Game.speed = 1;
Game.start = false;
Game.New = function()
{
var _loc1_ = this;
_loc1_.mspeed = 4.5;
_loc1_.level = 1;
_loc1_.player = new Object();
_loc1_.player.score = 0;
_loc1_.player.life = 3;
_loc1_.startTime = getTimer();
_loc1_.timer = getTimer();
_loc1_.start = true;
var _loc2_ = _loc1_.scene.createEmptyMovieClip("updater",100);
_loc2_.onEnterFrame = _loc1_.update;
};
Game.End = function()
{
var _loc1_ = this;
_loc1_.endTime = getTimer();
_loc1_.start = false;
_loc1_.speed = 0;
_loc1_.scene.Scoreboard.life.gotoAndStop(1);
removeMovieClip(_loc1_.scene.updater);
_loc1_.scene.play();
};
Game.update = function()
{
Game.player.score += Game.level * 0.01;
Game.scene.Scoreboard.score = Math.floor(Game.player.score);
Game.scene.Scoreboard.life.gotoAndStop(Game.player.life + 1);
var _loc2_ = String(Game.level);
if(_loc2_.length == 1)
{
_loc2_ = "0" + _loc2_;
}
var time = getTimer() - Game.startTime;
var totalSec = Math.floor(time / 1000);
var _loc1_ = totalSec % 60;
var _loc3_ = String((totalSec - _loc1_) / 60);
if(String(_loc1_).length == 1)
{
_loc1_ = "0" + _loc1_;
}
if(_loc3_.length == 1)
{
_loc3_ = "0" + _loc3_;
}
Game.scene.Scoreboard.time = _loc3_ + ":" + _loc1_;
Game.scene.Scoreboard.level = _loc2_;
if(getTimer() - Game.timer >= 35000)
{
Game.mspeed = Math.min(16,Game.mspeed + 1.25);
Game.level += 1;
Game.timer = getTimer();
}
Game.timer += 1;
if(Game.speed < Game.mspeed && !Game.pause)
{
Game.speed = Math.min(Game.mspeed,Game.speed + Game.mspeed / 100);
}
};
Game.submit = function()
{
gotoAndPlay(1);
};
_global.snd = new Object();
snd.mc = this;
snd.play = function(id)
{
var _loc1_ = id;
var _loc2_ = this;
if(_loc2_[_loc1_] == undefined)
{
_loc2_[_loc1_] = new Sound(_loc2_.mc);
_loc2_[_loc1_].attachSound(_loc1_);
}
_loc2_[_loc1_].start();
};